// import { type } from "os";

import { type } from "os"

type Deck = NormalCard[]
type CradColor = "❤"|"♠"|"♦"|"♣"
type NormalCard = {
    color:CradColor,
    mark:number
}
function createDock():Deck{
const deck:Deck = []; // 定义扑克
for (let index = 1; index <= 13; index++) {
   deck.push({
    mark:index,
    color:"♠"
   })
   deck.push({
    mark:index,
    color:"♣"
   })
   deck.push({
    mark:index,
    color:"♦"
   })
   deck.push({
    mark:index,
    color:"❤"
   })
    
}
return deck
}
// function findCards(color:CradColor){

// }
function printDeck(deck:Deck){
    let result="\n";
    deck.forEach((item,index)=>{
       let  str= item.color;
        if(item.mark == 0){
            str+=""
        }
        if(1<=item.mark&&item.mark <=10){
            str+= item.mark
        }
        if(item.mark == 11){
            str+="J"
        }
        if(item.mark == 12){
            str+="Q"
        }
        else if(item.mark == 13) {
            str+="K"
        }
        result +=str+"\t"
       if((index+1)%6 ===0){
        result += "\n"
       }
    })
    
    console.log(result)
}
const deck = createDock()
printDeck(deck)